package com.qiankunxu.processor;

import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @author : Hunter Huang
 * @since : 2023/12/16 14:04
 * {@literal : some description}
 */

@Component
public class MyBeanPostProcessor implements BeanPostProcessor {


    // 初始化之前调用
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) {
        //System.out.println("MyBeanPostProcessor... postProcessBeforeInitialization...");
        return BeanPostProcessor.super.postProcessBeforeInitialization(bean, beanName);
    }


    // 初始化之后调用
    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) {
        //System.out.println("MyBeanPostProcessor... postProcessAfterInitialization...");
        return BeanPostProcessor.super.postProcessAfterInitialization(bean, beanName);
    }
}
